<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>

<html>
  <head>
    
    <title>供应商管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    	
	<meta http-equiv="description" content="This is my page">
	
	<script type='text/javascript' src="<%=basePath %>/jquery/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/comm/js/map.js"></script>
	
	<link href="<%=basePath %>/background/css/layout.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/background/css/header.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/warehouse/css/button.css" rel="stylesheet" type="text/css" />
  </head>
  
  <body>
  
  <table  style="height: 100%;width: 100%;">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
   
  <table style="width: 100%;">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>查找供应商信息
     			<input type="button" value="查看谁有权限" class="small button orange"
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>	
     			</td>
     			<td align="right"> <a href="preaddsupplier_warehouse.action">添加供应商信息</a> </td>
     		</tr>
     	</table>
     	
     	<table align="center">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
    <form id="managesupplier_warehouse" name="managesupplier_warehouse" onSubmit="return true;" action="managesupplier_warehouse.action" method="POST" >
    	
			<table  border="0" >
				<tr>
				  <td>
					  查找供应商:<input type="text" name="searchStr" class="searchtxt" size="30" value="<s:property value="searchStr"/>"/>
					  <input type="submit" style="bottom: 3px;" class="large button blue" value="查找" />
				  </td>
			  </tr>
			</table>
	</form> 
	
	
		<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>供应商列表</td>
     		</tr>
     	</table>
		
		
		
		<table >
			<tr>
				
					<td>供应商ID</td>
					<td>供应商名称</td>
					<td>供应商</td>
					<td>电话</td>
					<td>手机</td>
					<td>qq</td>
					<td>操作</td>
				</tr>
		
			<s:iterator id="supplierList" value="supplierList">
				<tr>
					<td title="<s:property value="#supplierList.address_supplier"/>"><s:property value="#supplierList.id_supplier"/></td>
					<td><s:property value="#supplierList.name_supplier"/></td>
					<td><s:property value="#supplierList.manager_supplier"/></td>
					<td><s:property value="#supplierList.phone_supplier"/></td>
					<td><s:property value="#supplierList.mobile_supplier"/></td>
					
					<td><s:property value="#supplierList.qq_supplier"/></td>
					
					<td>
						<a href="premodifysupplier_warehouse.action?id=<s:property value="#supplierList.id_supplier"/>"> 修改 </a>
					
					</td>
				</tr>
			</s:iterator>
		</table>
	
	<table width="100%" border="0" cellpadding="0" bgcolor="" cellspacing="0" >
				<tr >
					<td >
						<%
						int pageSize = (Integer) request.getAttribute("pageSize");
						int beginPageNum =  (Integer) request.getAttribute("beginPageNum");
						int countRow =  (Integer) request.getAttribute("rowNum");
					    int countPage =(countRow-1)/pageSize+1;
					    
					   // String brand = (String)request.getAttribute("brand");//*/
					    
					    String searchstr = (String)request.getParameter("searchStr");//*/
					    if(searchstr != null){
					    	searchstr = searchstr.replaceAll("%", "%25");
					    }else{
					    	searchstr = "";
					    }
					    
					    //beginPageNum =  (pageNum - 1) * pageSize;
						StringBuffer chagePageBuff = new StringBuffer();
						if(countPage >= 2){
							for(int i=0;i<countPage;i++){
								if(beginPageNum == i*pageSize){
									%>
									<%=i+1 %>
									<%
								}else{
									%>
									<a href="managesupplier_warehouse.action?searchStr=<%=searchstr %>&beginPageNum=<%=i*pageSize %>">
									[<%=i+1 %>] </a>
									<%
								}
							}
						}
						//*/
						%>
					</td>

				</tr>
				
			</table>
			
	</td>
	
	
	
</tr>

</table>

</td>
</tr>
<tr valign="bottom">
	<td>
		<jsp:include page="/background/tail.jsp"></jsp:include>
	</td>
</tr>
</table>

  </body>

</html>
